package edu.mit.compilers.assembly.x64.basic;

import java.util.ArrayList;

public class X64RegisterOperand implements X64Operand {
    X64Register register;
    public X64RegisterOperand(X64Register register) {
        this.register = register;
    }

    @Override
    public String getAddress() {
        return "%" + register.name;
    }

    @Override
    public Type getType() {
        return Type.REGISTER;
    }

    @Override
    public ArrayList<X64Register> getUsedRegisters() {
        ArrayList<X64Register> ret = new ArrayList<>();
        ret.add(register);
        return ret;
    }
}
